import axios from "@/util/request.js";

export function getRoot(){
    return axios.post("permission/root");
}

export function save(permission){
    return axios.post("permission/save", permission);
}

export function update(permission){
    return axios.post("permission/update", permission);
}

export function del(permissionId){
    return axios.post("permission/delete", permissionId, axios.textConfig);
}

export function getPermission(roleId){
    return axios.post("permission/permissionByRole", roleId, axios.textConfig)
}

export function distributePermissions(roleId, permissionIds){
    return axios.post("permission/distributePermissions", {roleId: roleId, permissionIds: permissionIds})
}